/* @font-face {
    font-family: 'MinecraftAE';
    src: url('/api/font') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
} */

:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --card-bg-color: #f0f0f0;
    --accent-color: #dcdcdc;
    --accent-color-hover: #0284c7;
}

.dark-theme {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --card-bg-color: #2a2a2a;
    --accent-color: #3b82f6;
    --accent-color-hover: #2563eb;
}

body {
    font-family: 'MinecraftAE', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

#sidebar {
    width: 100px;
    background-color: var(--card-bg-color);
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#sidebar h2 {
    margin-bottom: 20px;
    text-align: center;
    white-space: nowrap;
    width: 100%;
}

#sidebar button {
    margin-bottom: 10px;
    text-align: center;
    padding: 10px;
    width: 80px;
    display: block;
    background-color: var(--card-bg-color);
    color: var(--text-color);
    border: 2px solid var(--accent-color);
    transition: background-color 0.3s, color 0.3s;
    cursor: pointer;
}

#sidebar button.active {
    background-color: var(--accent-color);
    color: white;
}

#manual-download {
    margin-top: 20px;
    width: 100%;
}

#layout-selector {
    margin-top: auto;
    text-align: center;
    /* width: 100%; */
}

#layout-selector select {
    padding: 10px 20px;
    background-color: var(--bg-color);
    border: 1px solid var(--accent-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s, color 0.3s;
    height: 40px;
    box-sizing: border-box;
    min-width: 100px;
    margin: 5px;
    /* width: 100%;
    padding: 5px;
    margin-top: 10px;
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--accent-color);
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s; */
}

#layout-selector select:hover {
    background-color: var(--accent-color);
    color: white;
}

#main-content {
    flex-grow: 1;
    padding: 40px;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
}

#search-bar {
    margin-bottom: 20px;
    display: flex;
    margin-top: 40px;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    width: 100%;
}

#search-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid var(--accent-color);
    border-radius: 5px;
    font-size: 16px;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 40px;
    box-sizing: border-box;
    min-width: 0;
}

#search-button {
    padding: 10px 20px;
    background-color: var(--bg-color);
    border: 1px solid var(--accent-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s, color 0.3s;
    height: 40px;
    box-sizing: border-box;
    min-width: 100px;
}

#search-button:hover {
    background-color: var(--accent-color);
    color: white;
}

#content {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}

#content::-webkit-scrollbar {
    display: none;
}

.item {
    background-color: var(--card-bg-color);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: calc(25% - 20px);
    max-height: 255px;
    box-sizing: border-box;
}

.item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.item.horizontal {
    display: flex;
    align-items: center;
    width: calc(50% - 20px);
}

.item.vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.item img {
    height: 64px;
    border-radius: 5px;
}

.item.horizontal img {
    margin-right: 15px;
}

.item.vertical img {
    margin-bottom: 10px;
}

.item-details {
    flex-grow: 1;
}

.item-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.item-description {
    font-size: 0.9em;
    color: var(--text-color);
    opacity: 0.8;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

#modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    overflow-y: auto;
}

.modal-content {
    padding: 50px;
    padding-left: 120px;
    padding-top: 30px;
    width: 100%;
    box-sizing: border-box;
}

#back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background-color: var(--accent-color);
    color: white;
    border: none;
    width: 68px;
    height: 40px;
    /* border-radius: 50%; */
    cursor: pointer;
    transition: background-color 0.3s;
    opacity: 0.8;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
}

#back-button:hover {
    background-color: var(--accent-color-hover);
}

.modal-header {
    display: flex;
    align-items: center;
    flex-direction: column;
    margin-bottom: 20px;
}

.modal-header img {
    width: 64px;
    height: 64px;
    margin-right: 20px;
}

.modal-header-text {
    flex-grow: 1;
}

h2 {
    color: var(--accent-color);
    margin-top: 0;
}

button {
    background-color: var(--accent-color);
    border: none;
    padding: 10px 15px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: var(--accent-color-hover);
}

.theme-switcher {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.theme-switcher select {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 5px 15px;
    cursor: pointer;
    border-radius: 5px;
}

#loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1002;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px;
    border-radius: 10px;
}

#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

#pagination button, #pagination span {
    margin: 0 5px;
    font-size: 18px;
    padding: 5px 10px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
}

#pagination span {
    background-color: transparent;
    color: var(--text-color);
}

#pagination::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        padding: 10px;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    #sidebar button {
        width: auto;
        margin: 0;
    }

    #layout-selector {
        width: auto;
        margin: 0;
    }

    #main-content {
        padding: 10px;
    }

    #search-bar {
        margin-top: 20px;
    }

    .item {
        width: 100%;
        margin: 10px 0;
    }

    .modal-content {
        padding: 10px;
        padding-top: 30px;
    }

    #back-button {
        top: 10px;
        left: 10px;
    }

    .theme-switcher {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 690px) {
    #search-bar {
        flex-direction: column;
    }

    #search-input,
    #layout-selector,
    #layoutSelect,
    #search-button {
        width: 100%;
        border-radius: 5px;
    }

    .modal-header {
        flex-direction: column;
        text-align: center;
    }

    .modal-header img {
        margin: 0 0 10px 0;
    }
}

.rating {
    display: inline-block;
    font-size: 24px;
}
.star {
    color: #ccc; /* Default star color */
}
.half-star {
    position: relative;
    width: 15px;
    /* overflow: hidden; */
    display: inline-block;
}
.half-star::before,
.half-star::after {
    content: '\2605'; /* Star character */
    position: absolute;
    top: 0;
    left: 0;
    color: gold; /* Color for filled stars */
}
.half-star::after {
    clip-path: inset(0 0 0 50%);
    color: #ccc; /* Empty part of the half star */
}
.full-star {
    color: gold; /* Color for filled stars */
}
.score-text{
    margin-left: 3px;
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.8em;
}

#modal-content {
    background-color: #fefefe;
    margin: 0 auto; 
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
  }
  
  .md h1, .md h2, .md h3, .md h4, .md h5, .md h6 {
    color: #333;
    margin-top: 0;
  }
  
  .md p {
    line-height: 1.6;
    margin: 5px;
    /* color: #666; */
  }
  
  .md a {
    color: #007BFF;
    text-decoration: none;
  }
  
  .md a:hover {
    text-decoration: underline;
  }
  
  .md ul, .md ol {
    list-style-position: inside !important;
    padding-left: 30px !important;
  }
  #modal-content ul{
    padding-left: 0px;
  }
  #modal-content li {
    list-style-position: outside;
    background-color: #efefef;
    padding: 10px;
    margin: 10px;
    border-radius: 10px;
    list-style-type: none;
  }
  .md li{
    list-style-position: outside !important;
    list-style-type: initial !important;
    padding: 0px !important;
    margin: 0px !important; 
  }

  .md button {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
  }
  

  .md button:hover {
    background-color: #0056b3;
  }
  
  /* Table styles */
  .md table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
  }
  
  .md th, .md td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
  }
  
  .md th {
    background-color: #f2f2f2;
  }
  
  .md tr:nth-child(even) {
    background-color: #f9f9f9;
  }
  
  .md tr:hover {
    background-color: #f1f1f1;
  }
  
  /* Image styles */
  .md img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
  }
  .md blockquote {
    margin: 20px 0;
    padding-left: 20px;
    border-left: 4px solid #ccc;
    font-style: italic;
    color: #6c757d;
  }
  
  /* Code styles */
  .md code ,.userscore{
    background-color: #d3d3d3;
    padding: 2px 4px;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 85%;
    /* color: #676767; */
    border-radius: 4px;
  }
  
  .userinfo{
    text-align: center;
  }
  a {
    text-decoration: none;
    }
.comment-button{
    text-align: center;
}